/**
 * 
 */
package be.bejug.scrumadmin.services.stub;

import java.util.Collections;
import java.util.Set;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import be.bejug.scrumadmin.KnowledgeCenter;
import be.bejug.scrumadmin.domain.Sprint;
import be.bejug.scrumadmin.domain.Story;
import be.bejug.scrumadmin.services.SprintService;

/**
 * @author Glenn Dejaeger
 * 
 */
@Service
public class SprintServiceStubImpl implements SprintService {

	@Autowired
	KnowledgeCenter knowledgeCenter;

	@Override
	public Set<Sprint> getAllSprints() {
		return knowledgeCenter.getSprints();
	}

	@SuppressWarnings("unchecked")
	@Override
	public Set<Story> getStories(final Sprint sprint) {
		if (sprint.getId() == 1) {
			return knowledgeCenter.getStoriesOfSprint1();
		} else if (sprint.getId() == 2) {
			return knowledgeCenter.getStoriesOfSprint2();
		} else if (sprint.getId() == 3) {
			return knowledgeCenter.getStoriesOfSprint3();
		} else if (sprint.getId() == 4) {
			return knowledgeCenter.getStoriesOfSprint4();
		} else {
			return Collections.EMPTY_SET;
		}
	}

	@Override
	public Sprint getCurrentSprint() {
		return knowledgeCenter.getCurrentSprint();
	}

}
